﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Workflow2211A.Domain.Migrations
{
    /// <inheritdoc />
    public partial class _3 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "TestItemId",
                table: "TestItems");

            migrationBuilder.DropColumn(
                name: "TestCategoryId",
                table: "TestCategories");

            migrationBuilder.DropColumn(
                name: "PrescriptionDetailId",
                table: "PrescriptionDetails");

            migrationBuilder.DropColumn(
                name: "PrescriptionId",
                table: "PrescriptionApplications");

            migrationBuilder.DropColumn(
                name: "MedicalInstitutionId",
                table: "MedicalInstitutions");

            migrationBuilder.DropColumn(
                name: "DrugCode",
                table: "DrugInfos");

            migrationBuilder.DropColumn(
                name: "CategoryId",
                table: "DrugCategories");

            migrationBuilder.DropColumn(
                name: "CheckupItemId",
                table: "CheckupItems");

            migrationBuilder.DropColumn(
                name: "CheckupCategoryId",
                table: "CheckupCategories");

            migrationBuilder.AlterColumn<Guid>(
                name: "InstanceId",
                table: "Workflow",
                type: "char(200)",
                maxLength: 200,
                nullable: false,
                collation: "ascii_general_ci",
                oldClrType: typeof(string),
                oldType: "char(200)",
                oldMaxLength: 200)
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<Guid>(
                name: "SubscriptionId",
                table: "Subscription",
                type: "char(200)",
                maxLength: 200,
                nullable: false,
                collation: "ascii_general_ci",
                oldClrType: typeof(string),
                oldType: "char(200)",
                oldMaxLength: 200)
                .OldAnnotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "InstanceId",
                table: "Workflow",
                type: "char(200)",
                maxLength: 200,
                nullable: false,
                oldClrType: typeof(Guid),
                oldType: "char(200)",
                oldMaxLength: 200)
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("Relational:Collation", "ascii_general_ci");

            migrationBuilder.AddColumn<long>(
                name: "TestItemId",
                table: "TestItems",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<long>(
                name: "TestCategoryId",
                table: "TestCategories",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AlterColumn<string>(
                name: "SubscriptionId",
                table: "Subscription",
                type: "char(200)",
                maxLength: 200,
                nullable: false,
                oldClrType: typeof(Guid),
                oldType: "char(200)",
                oldMaxLength: 200)
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("Relational:Collation", "ascii_general_ci");

            migrationBuilder.AddColumn<long>(
                name: "PrescriptionDetailId",
                table: "PrescriptionDetails",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<long>(
                name: "PrescriptionId",
                table: "PrescriptionApplications",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<long>(
                name: "MedicalInstitutionId",
                table: "MedicalInstitutions",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<long>(
                name: "DrugCode",
                table: "DrugInfos",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<long>(
                name: "CategoryId",
                table: "DrugCategories",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<long>(
                name: "CheckupItemId",
                table: "CheckupItems",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<long>(
                name: "CheckupCategoryId",
                table: "CheckupCategories",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);
        }
    }
}
